.class Lcom/nemustech/regina/ElementLocator$2$1;
.super Ljava/lang/Object;
.source "ElementLocator.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/nemustech/regina/ElementLocator$2;->onMove(F)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Lcom/nemustech/regina/ElementLocator$2;

.field final synthetic val$step:F


# direct methods
.method constructor <init>(Lcom/nemustech/regina/ElementLocator$2;F)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 284
    iput-object p1, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iput p2, p0, Lcom/nemustech/regina/ElementLocator$2$1;->val$step:F

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 14

    .prologue
    .line 287
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10}, Lcom/nemustech/regina/ElementLocator;->access$200(Lcom/nemustech/regina/ElementLocator;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v10

    invoke-virtual {v10}, Lcom/nemustech/regina/ReginaLauncher;->isSecretMode()Z

    move-result v3

    .line 288
    .local v3, fIsSecretMode:Z
    if-eqz v3, :cond_2

    const/4 v10, 0x1

    move v6, v10

    .line 289
    .local v6, fWorkspaceMode:I
    :goto_0
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10}, Lcom/nemustech/regina/ElementLocator;->access$200(Lcom/nemustech/regina/ElementLocator;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v10

    invoke-virtual {v10, v3}, Lcom/nemustech/regina/ReginaLauncher;->getWorkspaceViewGroup(Z)Landroid/view/ViewGroup;

    move-result-object v5

    .line 290
    .local v5, fViewGroup:Landroid/view/ViewGroup;
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceCount()I

    move-result v9

    .line 291
    .local v9, workspaceCount:I
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10}, Lcom/nemustech/regina/ElementLocator;->access$500(Lcom/nemustech/regina/ElementLocator;)[Lcom/nemustech/regina/RGWorkspaceHolder;

    move-result-object v10

    aget-object v10, v10, v6

    invoke-virtual {v10}, Lcom/nemustech/regina/RGWorkspaceHolder;->getCurrentWorkspaceIndex()I

    move-result v2

    .line 293
    .local v2, fCurWorkspaceIdx:I
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10}, Lcom/nemustech/regina/ElementLocator;->access$600(Lcom/nemustech/regina/ElementLocator;)[I

    move-result-object v10

    aget v7, v10, v6

    .line 295
    .local v7, prevWsIdx:I
    if-eq v7, v2, :cond_1

    .line 299
    iget v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->val$step:F

    const/4 v11, 0x0

    cmpg-float v10, v10, v11

    if-gez v10, :cond_3

    .line 300
    add-int/lit8 v10, v7, 0x1

    rem-int v8, v10, v9

    .line 301
    .local v8, removeIndex:I
    const/4 v10, 0x1

    sub-int v10, v2, v10

    add-int/2addr v10, v9

    rem-int v0, v10, v9

    .line 302
    .local v0, addIndex:I
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10, v6, v8}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceView(II)Lcom/nemustech/regina/WorkspaceView;

    move-result-object v4

    .line 303
    .local v4, fRemoveView:Landroid/view/View;
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10, v6, v0}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceView(II)Lcom/nemustech/regina/WorkspaceView;

    move-result-object v1

    .line 306
    .local v1, fAddView:Landroid/view/View;
    invoke-virtual {v5}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v10

    const/4 v11, 0x3

    if-eq v10, v11, :cond_0

    .line 307
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10, v7}, Lcom/nemustech/regina/ElementLocator;->access$700(Lcom/nemustech/regina/ElementLocator;I)V

    .line 309
    :cond_0
    invoke-virtual {v5, v4}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 310
    const/4 v10, 0x0

    new-instance v11, Landroid/view/ViewGroup$LayoutParams;

    const/4 v12, -0x1

    const/4 v13, -0x1

    invoke-direct {v11, v12, v13}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v5, v1, v10, v11}, Landroid/view/ViewGroup;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

    .line 311
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10}, Lcom/nemustech/regina/ElementLocator;->refreshLayout()V

    .line 312
    invoke-virtual {v5}, Landroid/view/ViewGroup;->invalidate()V

    .line 331
    .end local v0           #addIndex:I
    .end local v1           #fAddView:Landroid/view/View;
    .end local v4           #fRemoveView:Landroid/view/View;
    .end local v8           #removeIndex:I
    :cond_1
    :goto_1
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10}, Lcom/nemustech/regina/ElementLocator;->access$200(Lcom/nemustech/regina/ElementLocator;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v10

    invoke-virtual {v10, v3}, Lcom/nemustech/regina/ReginaLauncher;->getWorkspaceViewGroup(Z)Landroid/view/ViewGroup;

    move-result-object v10

    iget-object v11, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v11, v11, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v11}, Lcom/nemustech/regina/ElementLocator;->access$500(Lcom/nemustech/regina/ElementLocator;)[Lcom/nemustech/regina/RGWorkspaceHolder;

    move-result-object v11

    aget-object v11, v11, v6

    invoke-virtual {v11}, Lcom/nemustech/regina/RGWorkspaceHolder;->getDeviation()F

    move-result v11

    invoke-virtual {v5}, Landroid/view/ViewGroup;->getWidth()I

    move-result v12

    int-to-float v12, v12

    mul-float/2addr v11, v12

    float-to-int v11, v11

    const/4 v12, 0x0

    invoke-virtual {v10, v11, v12}, Landroid/view/ViewGroup;->scrollTo(II)V

    .line 332
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10}, Lcom/nemustech/regina/ElementLocator;->access$600(Lcom/nemustech/regina/ElementLocator;)[I

    move-result-object v10

    aput v2, v10, v6

    .line 333
    return-void

    .line 288
    .end local v2           #fCurWorkspaceIdx:I
    .end local v5           #fViewGroup:Landroid/view/ViewGroup;
    .end local v6           #fWorkspaceMode:I
    .end local v7           #prevWsIdx:I
    .end local v9           #workspaceCount:I
    :cond_2
    const/4 v10, 0x0

    move v6, v10

    goto/16 :goto_0

    .line 313
    .restart local v2       #fCurWorkspaceIdx:I
    .restart local v5       #fViewGroup:Landroid/view/ViewGroup;
    .restart local v6       #fWorkspaceMode:I
    .restart local v7       #prevWsIdx:I
    .restart local v9       #workspaceCount:I
    :cond_3
    iget v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->val$step:F

    const/4 v11, 0x0

    cmpl-float v10, v10, v11

    if-lez v10, :cond_1

    .line 314
    const/4 v10, 0x1

    sub-int v10, v7, v10

    add-int/2addr v10, v9

    rem-int v8, v10, v9

    .line 315
    .restart local v8       #removeIndex:I
    add-int/lit8 v10, v2, 0x1

    rem-int v0, v10, v9

    .line 316
    .restart local v0       #addIndex:I
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10, v6, v8}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceView(II)Lcom/nemustech/regina/WorkspaceView;

    move-result-object v4

    .line 317
    .restart local v4       #fRemoveView:Landroid/view/View;
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10, v6, v0}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceView(II)Lcom/nemustech/regina/WorkspaceView;

    move-result-object v1

    .line 321
    .restart local v1       #fAddView:Landroid/view/View;
    invoke-virtual {v5}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v10

    const/4 v11, 0x3

    if-eq v10, v11, :cond_4

    .line 322
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-static {v10, v7}, Lcom/nemustech/regina/ElementLocator;->access$700(Lcom/nemustech/regina/ElementLocator;I)V

    .line 325
    :cond_4
    invoke-virtual {v5, v4}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 326
    new-instance v10, Landroid/view/ViewGroup$LayoutParams;

    const/4 v11, -0x1

    const/4 v12, -0x1

    invoke-direct {v10, v11, v12}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v5, v1, v10}, Landroid/view/ViewGroup;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 327
    iget-object v10, p0, Lcom/nemustech/regina/ElementLocator$2$1;->this$1:Lcom/nemustech/regina/ElementLocator$2;

    iget-object v10, v10, Lcom/nemustech/regina/ElementLocator$2;->this$0:Lcom/nemustech/regina/ElementLocator;

    invoke-virtual {v10}, Lcom/nemustech/regina/ElementLocator;->refreshLayout()V

    .line 328
    invoke-virtual {v5}, Landroid/view/ViewGroup;->invalidate()V

    goto :goto_1
.end method
